package com.seven.springcloud.service;

import com.seven.springcloud.entity.CommonResult;
import com.seven.springcloud.entity.Payment;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.lang.reflect.Method;

/**
 * @Author seven
 * @Date 2020/4/23 15:43
 **/
@Component
public class PaymentFallbackService implements FeignPaymentService{

    @Override
    public String paymentInfo_OK(@PathVariable("id")Integer id) {
        String methodName = null;
        try {
            Method method = this.getClass().getMethod("paymentInfo_OK", Integer.class);
            methodName= method.getName();
        } catch (NoSuchMethodException e) {
            e.printStackTrace();
        }
        return "------>"+methodName+"fall back o(╥﹏╥)o";
    }

    @Override
    public String paymentInfo_timeOut(@PathVariable("id")Integer id) {
        return "------>"+
                this.getClass().getName()+"fall back o(╥﹏╥)o";
    }
}
